package com.chen.glide_ex;

import android.content.Context;
import android.support.annotation.NonNull;

import com.bumptech.glide.Glide;
import com.bumptech.glide.Registry;
import com.bumptech.glide.annotation.GlideModule;
import com.bumptech.glide.module.AppGlideModule;

import java.io.InputStream;


@GlideModule
public final class CustomGlideModule extends AppGlideModule {

    //注册自定义组件
    @Override
    public void registerComponents(@NonNull Context context, @NonNull Glide glide, @NonNull Registry registry) {
        registry.append(Base64Entity.class, InputStream.class, new OlyBase64StreamFactory<Base64Entity>());

    }

    // 避免二次加载
    @Override
    public boolean isManifestParsingEnabled() {
        return false;
    }
}